<template>
  <cpm-card>
    <div slot="com_header"></div>

    <div slot="com_content">
      <el-table :data="dataSource">
        <el-table-column type="index" label="序号"></el-table-column>
        <el-table-column prop="authName" label="权限名称"></el-table-column>
        <el-table-column prop="path" label="权限路径"></el-table-column>
        <el-table-column label="权限级别">
          <template #default="{ row }">
            <el-tag v-show="row.level == 0">一级</el-tag>
            <el-tag v-show="row.level == 1" type="success">二级</el-tag>
            <el-tag v-show="row.level == 2" type="werning">三级</el-tag>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </cpm-card>
</template>

<script>
import ComCard from "../../components/comCard/index.vue";
import { api_getRight } from "../../api/right.js";
export default {
  components: {
    ComCard,
  },
  data() {
    return {
      dataSource: [],
    };
  },
  mounted() {
    this.query();
  },
  methods: {
    async query() {
      let rst = await api_getRight({ url: "list" });
      if (rst.meta.status == 200) {
        this.dataSource = rst.data;
      }
      console.log(rst);
      console.log(this.dataSource);
    },
  },
};
</script>

<style lang="less" scoped>
</style>